//
//  BaseTableViewController.swift
//  SK-微博
//
//  Created by 姜胜凯 on 15/10/8.
//  Copyright © 2015年 姜胜凯. All rights reserved.
//

import UIKit

class BaseTableViewController: UITableViewController,visitLoginViewDelegate {

    //设置访客视图
    var visitView :VisiterLoginView?
    let userLogin = false
    override func loadView() {
        userLogin ? super.loadView() : setupVisitView()
    }
    
    
    func setupVisitView(){
        
        visitView = VisiterLoginView()
        visitView?.delegate = self
        view = visitView
        //view.backgroundColor = UIColor.whiteColor()
    //设置状态栏
        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "注册", style: UIBarButtonItemStyle.Plain, target: self, action: "visitLoginViewWillRegist")
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "登录", style: UIBarButtonItemStyle.Plain, target: self, action: "visitloginViewWillLogin")
    }
    //实现代理方法
    func visitloginViewWillLogin() {
        let navigation = UINavigationController(rootViewController: OAuthViewController())
        presentViewController(navigation, animated: true, completion: nil)
    }
    func visitLoginViewWillRegist() {
        print("注册")
    }
}
